package com.metier;

import java.io.Serializable;

import com.dao.ExperienceDAO;
import com.dao.UtilisateurBasiqueDAO;


/**
 * This is an object that contains data related to the experience table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="experience"
 */

public abstract class BaseExperience  implements Serializable {

	public static String REF = "Experience";
	public static String PROP_FK_SOCIETE = "FkSociete";
	public static String PROP_DESCRIPTION = "Description";
	public static String PROP_FIN = "Fin";
	public static String PROP_POSTE = "Poste";
	public static String PROP_ACTUEL = "Actuel";
	public static String PROP_ID = "Id";
	public static String PROP_DIRECTION = "Direction";
	public static String PROP_DEBUT = "Debut";


	// constructors
	public BaseExperience () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseExperience (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseExperience (
		com.metier.Societe fkSociete,
		java.lang.String poste,
		java.lang.Long debut,
		java.lang.Long fin,
		java.lang.String direction,
		boolean actuel) {

		this.setFkSociete(fkSociete);
		this.setPoste(poste);
		this.setDebut(debut);
		this.setFin(fin);
		this.setDirection(direction);
		this.setActuel(actuel);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String poste;
	private java.lang.Long debut;
	private java.lang.Long fin;
	private java.lang.String direction;
	private boolean actuel;
	private java.lang.String description;

	// many to one
	private com.metier.Societe fkSociete;

	// collections
	private java.util.Set<com.metier.News> news;
	private java.util.Set<com.metier.Contexte> contextes;
	private java.util.Set<com.metier.Utilisateur> utilisateurs;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="id_exp"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: poste
	 */
	public java.lang.String getPoste () {
		return poste;
	}

	/**
	 * Set the value related to the column: poste
	 * @param poste the poste value
	 */
	public void setPoste (java.lang.String poste) {
		this.poste = poste;
	}


	public void setFkSociete(ISociete societe) {
		// TODO Auto-generated method stub
		this.fkSociete =(Societe) societe;
	}
	

	/**
	 * Return the value associated with the column: debut
	 */
	public java.lang.Long getDebut () {
		return debut;
	}

	/**
	 * Set the value related to the column: debut
	 * @param debut the debut value
	 */
	public void setDebut (java.lang.Long debut) {
		this.debut = debut;
	}



	/**
	 * Return the value associated with the column: fin
	 */
	public java.lang.Long getFin () {
		return fin;
	}

	/**
	 * Set the value related to the column: fin
	 * @param fin the fin value
	 */
	public void setFin (java.lang.Long fin) {
		this.fin = fin;
	}



	/**
	 * Return the value associated with the column: direction
	 */
	public java.lang.String getDirection () {
		return direction;
	}

	/**
	 * Set the value related to the column: direction
	 * @param direction the direction value
	 */
	public void setDirection (java.lang.String direction) {
		this.direction = direction;
	}



	/**
	 * Return the value associated with the column: actuel
	 */
	public boolean isActuel () {
		return actuel;
	}

	/**
	 * Set the value related to the column: actuel
	 * @param actuel the actuel value
	 */
	public void setActuel (boolean actuel) {
		this.actuel = actuel;
	}



	/**
	 * Return the value associated with the column: description
	 */
	public java.lang.String getDescription () {
		return description;
	}

	/**
	 * Set the value related to the column: description
	 * @param description the description value
	 */
	public void setDescription (java.lang.String description) {
		this.description = description;
	}



	/**
	 * Return the value associated with the column: fk_societe
	 */
	public com.metier.Societe getFkSociete () {
		return fkSociete;
	}

	/**
	 * Set the value related to the column: fk_societe
	 * @param fkSociete the fk_societe value
	 */
	public void setFkSociete (com.metier.Societe fkSociete) {
		this.fkSociete = fkSociete;
	}



	/**
	 * Return the value associated with the column: News
	 */
	public java.util.Set<com.metier.News> getNews () {
		return news;
	}

	/**
	 * Set the value related to the column: News
	 * @param news the News value
	 */
	public void setNews (java.util.Set<com.metier.News> news) {
		this.news = news;
	}



	/**
	 * Return the value associated with the column: Contextes
	 */
	public java.util.Set<com.metier.Contexte> getContextes () {
		return contextes;
	}

	/**
	 * Set the value related to the column: Contextes
	 * @param contextes the Contextes value
	 */
	public void setContextes (java.util.Set<com.metier.Contexte> contextes) {
		this.contextes = contextes;
	}

	public void addToContextes (com.metier.Contexte contexte) {
		if (null == getContextes()) setContextes(new java.util.TreeSet<com.metier.Contexte>());
		getContextes().add(contexte);
	}



	/**
	 * Return the value associated with the column: Utilisateurs
	 */
	public java.util.Set<com.metier.Utilisateur> getUtilisateurs () {
		return utilisateurs;
	}

	/**
	 * Set the value related to the column: Utilisateurs
	 * @param utilisateurs the Utilisateurs value
	 */
	public void setUtilisateurs (java.util.Set<com.metier.Utilisateur> utilisateurs) {
		this.utilisateurs = utilisateurs;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.metier.Experience)) return false;
		else {
			com.metier.Experience experience = (com.metier.Experience) obj;
			if (null == this.getId() || null == experience.getId()) return false;
			else return (this.getId().equals(experience.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}
	
	


}